<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/app/common/header.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户管理</title>
</head>

<body>
<form id="mainForm" action="<%=basePath%>app/sys/user/user!list" method="post">
<div id="container">

  <table width="100%" border="0" id="topSpace">
    <tr>
      <td>    
      </td>
    </tr>
  </table>
  <div class="checkinforbox">
   		<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
		<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
		<input type="hidden" name="page.order" id="order" value="${page.order}"/>
   <div id="search">
    <table cellspacing="1" border="0" width="100%" cellpadding="2">
    <tr >
      <th colspan="4" class="stitle">用户信息管理</th>
    </tr>
      <tr>
        <th width="15%" >用户名称</th>
        <td width="35%"><label>
          <input type="text" class="input" id="filter_LIKES_loginName" name="filter_LIKES_loginName" value="${param['filter_LIKES_loginName']}" style="width:140px"/>
        </label></td>
          
        <th width="15%">显示名称</th>
        <td width="35%"><label>
          <input type="text" class="input" id="filter_LIKES_showName" name="filter_LIKES_showName" value="${param['filter_LIKES_showName']}" style="width:140px"/>
        </label></td>
      </tr>
      
      <tr>
        <th width="15%" >权限级别</th>
         <td width="35%"><select name="filter_EQS_status" id="status">
                    <option value="">全部</option>  
					<option value="high" <c:if test="${param['filter_EQS_type'] eq 'Y'}">selected="selected"</c:if> >一级</option>
					<option value="mid" <c:if test="${param['filter_EQS_type'] eq 'N'}">selected="selected"</c:if> >二级</option>
					<option value="low" <c:if test="${param['filter_EQS_type'] eq 'N'}">selected="selected"</c:if> >三级</option>
				</select>&nbsp;</td>
          
        <th width="15%">状态</th>
        <td width="35%"><select name="filter_EQS_status" id="status">
                    <option value="">全部</option>  
					<option value="Y" <c:if test="${param['filter_EQS_status'] eq 'Y'}">selected="selected"</c:if> >在用</option>
					<option value="N" <c:if test="${param['filter_EQS_status'] eq 'N'}">selected="selected"</c:if> >停用</option>
				</select>&nbsp;</td>
      </tr>
      <tr>
         <td colspan="4" class="searchCon">
        <div class="anniu01style" style="text-align:center" ><label> 
          <input name="button3" type="button" class="submit" id="button3" value="查询" onclick="$('#pageNo').val('1');submit();"/>
        </label>          &nbsp;&nbsp;&nbsp;&nbsp;
        <label>
          <input name="button4" type="button" class="submit" id="button4" value="重置" onclick="javascript:location.href='<%=basePath%>app/sys/user/user!list'"/>
        </label></td>
      </tr>
    </table>
  </div>
   
  </br>
   <c:if test="${user.type eq 'high'}">
   <div id='result'>
 <table  border='0' cellpadding='2' cellspacing='1' >
   <tr>
		<td id="resultCon">
     
      <input type="button" name="button2" id="button2" class="submit" value="添加" onclick="javascript:location.href='<%=basePath%>app/sys/user/user!input'"/>&nbsp;&nbsp;&nbsp;
    </label>
    <label>
      <input type="button" name="button" id="button" class="submit" value="删除" onclick="if(del())submit();"/>
    </label>
    </td>
    </tr>
  </table>
  </div>
  </c:if>
  <div id='result'><table id='tablelist' border='0' cellpadding='2' cellspacing='1' >
	    <tr id='titlerow'>
	    		<th id=tabletitle class='stitle'><input type="checkbox" name="checkAll" id="checkAll" />全选</th>
	      		<th id=tabletitle class='stitle'>用户名称</th>
	     		<th id=tabletitle class='stitle'>显示名称</th>
	     		<th id=tabletitle class='stitle'>权限级别</th>
	     		<th id=tabletitle class='stitle' >状态</th>
	    </tr>
	    <s:if test="page.totalCount==0">
		    <tr>
		    	<td align="center" colspan="11" style="color:red;font-size:12px;">没有找到任何记录</td>
	    	</tr>
	    </s:if>
			<s:iterator value="page.result" status="groupStatus">
			<s:if test="#groupStatus.odd == true ">
				 <tr>
			 </s:if>
			 <s:else>
				 <tr class="tabstylesecond">
			 </s:else>
 				<td  align="center"><input type="checkbox" name="chkDel" value="${id }"/></td>
 				<td  align="center" style="cursor:hand;" onclick="doEdit('${id}')">${loginName}&nbsp;</td>
	            <td  align="center" style="cursor:hand;" onclick="doEdit('${id}')">${showName}&nbsp;</td>
	            <td  align="center" style="cursor:hand;" onclick="doEdit('${id}')">
		            <c:if test="${type eq 'high'}">一级</c:if> 
		            <c:if test="${type eq 'mid'}">二级</c:if> 
		            <c:if test="${type eq 'low'}">三级</c:if> 
	            &nbsp;</td>
	            <td  align="center" style="cursor:hand;" onclick="doEdit('${id}')"><c:if test="${status=='Y'}">在用</c:if> <c:if test="${status=='N'}">停用</c:if>&nbsp;</td>
			 </tr>
		  </s:iterator>
		    </table>
		    <TABLE border='0' cellpadding='2' cellspacing='1' id='pageMark'>
		    <tr align="center">
		      <td height="30" colspan="11" >
			  <%@ include file="/app/common/turnPage.jsp" %>
			  </td>
		    </tr>																										
		</table>
		 <div style="font-size:12px;color:red" align="center"><s:actionmessage/></div>
  </div>
</div>
</form>
<script type="text/javascript">

 	function doEdit(id){
 		location.href="<%=basePath%>app/sys/user/user!input?id="+id;
 	}

 	function del(){
 	 	var lns = $("input[name=chkDel]:checked").length;
 	 	if(lns==0){
			//alert("请选择要删除的记录");
			Ext.MessageBox.show({
		           title: '提示',
		           msg: '请选择要删除的记录',
		           buttons: Ext.MessageBox.OK,
		           icon: Ext.MessageBox.WARNING
		       });
			return false;
 	 	}else{
 	 		Ext.MessageBox.confirm('', '是否删除选中的记录？',function(btn){
 	 			if(btn=="yes"){
 	 				$("#mainForm").attr("action","<%=basePath%>app/sys/user/user!delete");
 	 	 			$("#mainForm").submit();
 	 	 		}
 	 	 	});
 	 	}
 	}
 </script>
 <script language="javascript">
	  
	     var table=new TableObject("tablelist","titlerow");
	     table.setTitleBackgroundColor("#ebebeb");
	     table.setPageBackgroundColor("#ebebeb");
	     table.setRowBackgroundColor1("#FFFFFF");
	     table.setRowBackgroundColor2("#ECEEF6");
	     table.setRowClickBackgroudColor("#ebebeb");
	     table.setColClickBackgroudColor("#ebebeb");
	     table.setRowMouseOnBackgroundColor("#B3ECFF");
	     table.setColMouseOnBackgroundColor("#B3ECFF");
	     table.setEnableRowRightMenu("true");
	     table.setEnableTitleRightMenu("false");
	     table.setEnableChangColColor("false");
	     table.setEnableChangRowColor("true");
	     table.setEnableRowClick("false");
	     table.setEnableTitleClick("false");
	     table.setEnableTitleSort("false");
	     table.setSortDESCinnerHTML("↑");
	     table.setSortASCinnerHTML("↓");
		 table.initBackgroudColor();
		 table.initEvent();
			
</script>
</body>
</html>
